Align TROP lambda conventions with paper (Athey et al. 2025)#119
Merged
Align TROP lambda conventions with paper (Athey et al. 2025)#119
Conversation
Fix disabled-parameter semantics for λ_time and λ_unit to match the paper's convention: 0.0 means uniform weights (exp(-0×dist)=1), not ∞. Only λ_nn=∞ remains valid (disables factor model). Add ValueError validation rejecting inf in time/unit grids, remove dead ∞→0 conversions in Python and Rust, fix Stage 1 LOOCV fixed values, and update Registry equations to match Section 2.2 and Eq. 2-3 of the paper. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Overall assessment: Executive summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
Defense-in-depth: validate lambda_time_grid and lambda_unit_grid don't contain inf in loocv_grid_search and loocv_grid_search_joint Rust entrypoints, matching the Python-side validation. Fix univariate_loocv_search docstring to use paper conventions (0.0 for uniform weights, inf only for disabling factor model). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment:
|
The Returns docstring still claimed λ_time/λ_unit=∞ were converted to 0.0 internally. This contradicts the constructor validation added in this PR which now raises on inf for those grids. Updated to accurately state that inf is not accepted for λ_time/λ_unit while λ_nn=∞ is still converted to 1e10. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: ✅ Looks goodExecutive summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.0= uniform weights (exp(-0×dist)=1), not∞ValueErrorvalidation rejectinginfinlambda_time_gridandlambda_unit_grid∞→0.0conversions for time/unit lambdas in Python (4 locations) and Rust (5 locations)lambda_time=0.0(was∞)Methodology references (required if estimator / math changes)
λ_time=∞andλ_unit=∞were accepted and converted to 0.0 internally. The paper usesλ=0directly for uniform weights. Onlyλ_nn=∞(factor model disabled) is a valid infinity input.Validation
tests/test_trop.py— 4 tests updated to use0.0instead ofinffor time/unit grids, 1 new test forValueErroroninfin time/unit gridsmaturin develop --releaseSecurity / privacy
Generated with Claude Code